import { Component, SkipSelf } from '@angular/core';
import { Flower } from '../flower';
import { CComponent } from './c.component';

@Component({
  selector: 'app-b',
  standalone: true,
  imports: [CComponent],
  providers: [
    {
      provide: Flower,
      useValue: new Flower('🌺'),
    },
  ],
  viewProviders: [
    {
      provide: Flower,
      useValue: new Flower('🌻'),
    },
  ],
  template: `
    B (<code>&#64;SkipSelf</code>): {{ flower.name }}
    <br />
    <app-c [prefix]="prefix" />
    <ng-content></ng-content>
  `,
})
export class BComponent {
  prefix = "B's view";
  constructor(@SkipSelf() public flower: Flower) {}
}
